<?php
/**
 * Created by PhpStorm.
 * User: linux
 * Date: 23/01/2018
 * Time: 10:46 PM
 */
namespace DecoratorPattern;

use DecoratorPattern\Shape\CircleShape;
use DecoratorPattern\Shape\RedCircleShape;

function test()
{
//    $circle = new CircleShape(); 本行代码替换为下一行代码
    $circle = new RedCircleShape(new CircleShape());
    $circle->draw();
}